package com.collectionAndMap.collection.genericity;

/***
 * @ClassName: Test
 * @Description:
 * @Auther: 送一一块二向箔
 * @Date: 16:58 2022/2/15
 * @version : V1.0
 */
public class Test {
    public static void main(String[] args) {
        //使用泛型类创建对象
        // 注意： 1. 泛型只能使用引用类型
        //			 2. 不用泛型类型对象之间不能相互赋值
        GenericityDemo<String> myGeneric = new GenericityDemo<String>();
        myGeneric.t = "hello";
        myGeneric.show("hello world!");
        String string = myGeneric.getT();

        GenericityDemo<Integer> myGeneric2 = new GenericityDemo<Integer>();
        myGeneric2.t = 100;
        myGeneric2.show(200);
        Integer integer = myGeneric2.getT();

        new Impl1().server("666");
        new Impl2<Integer>().server(1000);
    }
}
